import logging


from DrissionPage import ChromiumPage, ChromiumOptions, SessionPage

logging.basicConfig(
    level=logging.INFO, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s"
)
logger = logging.getLogger(__name__)
# 设置浏览器路径（只需第一次运行时取消注释，之后可注释掉）
# ChromiumOptions().set_browser_path(
#     r"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome "
# ).save()

page = ChromiumPage()

try:
    page.get("https://static.docs-hub.com/7_1750227952921.html")
    # page.get("https://gitee.com/login")
    # page.ele("#user_login").input("aisource")
    # page.ele("#user_password").input("aisource3000")
    # page.ele("@name=commit").click()

except Exception as e:
    print(f"打开boss直聘网页失败: {e}")
# page.wait(3)
# page.screenshot("baidu.png")
# page.close()
# print("Chromium", Chromium)


# class Spider:
#     def crawl_jobs(self):
#         logger.info("Crawling jobs...")


# if __name__ == "__main__":
#     # run_spider()
#     try:
#         spider = Spider()
#         spider.crawl_jobs()
#     except Exception as e:
#         logger.error(f"Error: {e}")
#         raise
#     finally:
#         logger.info("Spider finished.")
